package function

import function.StudentT.{school, study}

/**
 *
 * @param name
 * @param age
 */
class StudentT(name:String, age:Int){
  //定义student类，里面放置各种私有属性和私有方法
  def studentInfo(): Unit ={
    println(name+","+age+","+StudentT.school)
    println(s"${name}在${StudentT.school}学习")
    study("王五").foreach(print)
  }
  val sex="男"


}


object StudentT {
  val school: String = "英吉利" //此方法对于Student类来说是全局的

   def study(sc: String): String = {
     val str: String = sc.+(s"sc "*10)
     //等价于val str=str+sc
     str
  }
}

